#include "HGEWindow.h"

HGEWindow::HGEWindow()
{

}
HGEWindow::~HGEWindow()
{
}

bool HGEWindow::Setup(HWND a_parent, HINSTANCE a_hInst, int a_xPos, int a_yPos, int a_width, int a_height, char* a_pWindowName, char* a_pClassName, DWORD a_style)
{
	WNDCLASS wndClass;
	ZeroMemory(&wndClass, sizeof(WNDCLASS));

	wndClass.cbClsExtra = NULL;
	wndClass.cbWndExtra = sizeof(Controller*);
	wndClass.hbrBackground = (HBRUSH)GetStockObject(LTGRAY_BRUSH);
	wndClass.hCursor = LoadCursor(NULL, IDC_ARROW);
	wndClass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
	wndClass.hInstance = a_hInst;
	wndClass.lpfnWndProc = Controller::WndProc;
	wndClass.lpszMenuName = NULL;
	wndClass.style = CS_DROPSHADOW;
	wndClass.lpszClassName = a_pClassName;

	if(!RegisterClass(&wndClass))
	{
		return false;
	}

	m_hWnd = CreateWindowEx(NULL, a_pClassName, a_pWindowName, a_style, a_xPos, a_yPos, a_width, a_height, a_parent, NULL, a_hInst, (LPVOID)this);
	if(m_hWnd == NULL)
	{
		return false;
	}
	UpdateWindow(m_hWnd);
	ShowWindow(m_hWnd, SW_SHOW);

	return true;
}
void HGEWindow::KeyDown(HWND a_hWnd, WPARAM a_wParam)
{
	//HWND = 
	int one = 1;
	if(a_wParam == VK_RETURN)
	{
			int one = 1;
	}
}
void HGEWindow::Update()
{
}
void HGEWindow::Activate(WPARAM a_wParam)
{
}
void HGEWindow::Close()
{
	PostQuitMessage(0);
}
void HGEWindow::Destroy()
{
	PostQuitMessage(0);
}
void HGEWindow::Size(int a_w, int a_h, LPARAM a_lParam)
{
}
void HGEWindow::Command(int a_id, int a_cmd, LPARAM a_msg)
{
}
void HGEWindow::AfterMessages()
{
}
void HGEWindow::ContextMenu(HWND a_hWnd, int a_x, int a_y)
{
}
void HGEWindow::RButtonDown(WPARAM a_wParam, int a_x, int a_y)
{
}